<script language="Javascript">
// Gets a element by its Id. Used for shorter coding.
function GetE( elementId )
{
	return document.getElementById( elementId )  ;
}

function SetAttribute( element, attName, attValue )
{
	if ( attValue == null || attValue.length == 0 )
		element.removeAttribute( attName, 0 ) ;			// 0 : Case Insensitive
	else
		element.setAttribute( attName, attValue, 0 ) ;	// 0 : Case Insensitive
}


</script>



<form id="DivisionsForm" name="DivisionsForm" method="post" action="" runat="server">
<input name="divisionID" type="hidden" id="divisionID" runat="server">
<input name="page" type="hidden" id="page" runat="server">
<hr>
<core:optional for="msg">
	<span class="message" runat="server"> {$msg} </span>
</core:optional>
<table width="100%" border="0" align="center" cellspacing="2" cellpadding="3">
	<tr>
	<td colspan="2" class="textlogin" style="font-size:10pt;left-pedding:20;padding-bottom:5;">
		Note: Fields marked with asterick (<font color="red">*</font>) are obligatory
	</td>
	</tr>
    <tr align="left">
    	<td class="whiteheader_center">
    		<core:optional for="divisionID">
    			Edit the Division (ID: {$divisionID})
            </core:optional>
            <core:default for="divisionID">
            	Create a new Division
            </core:default>
         </td>
         <td class="whiteheader">
            <a href="/{$#app_name}/myprofile/index.htm"> My Profile </a> &nbsp;
           	<html:link url="/">All divisions </html:link>
          </td>
     </tr>

    <core:default for="supress_errors">
    <ERRORSUMMARY id='Summary' runat="server">
        <tr valign="top">
          <td width="{$#width}">Errors: &nbsp;</td>
          <td class="left">
          	<FONT COLOR="RED">
          		<list:ITEM> {$ErrorMessage} &nbsp; </list:ITEM>
          	</FONT>
          </td>
        </tr>
     </ERRORSUMMARY>
     </core:default>

     <tr>
     	<td class="small" colspan="2">
     		<core:optional for="divisionID">
     			Enter your changes to the information below to edit an existing content item.
     			When you are finished, press the Save button.
            </core:optional>
     	</td>
     </tr>




     <tr valign="top">
       <td class="form_label" width="{$#width}">
      	 <label for="title" runat="server"><font color="red">*</font>Division Name</label>
       </td>
       <td class="form_field">
         <input name="divisionName" type="text" id="divisionName" size="64" runat="server">
         <span class="small"> 112 characters limit </span>
       </td>
     </tr>

     <tr valign="top">
       <td class="form_label" width="{$#width}">
      	 <label for="leagueID" runat="server">League</label>
       </td>
       <td class="form_field">
      	 <select name='leagueID' id='leagueID' runat="server">
	 	 </select>
       </td>
     </tr>





     <core:optional for="divisionID">
     <tr valign="top">
       <td class="form_label" width="{$#width}">
      	 <label for="date_added" runat="server">Date Posted:</label>
       </td>
       <td class="form_field">
         <span class="small"> {$date_added} </span>
       </td>
     </tr>

     </core:optional>


     <core:optional for="staff_user">
     <tr valign="top">
       <td class="form_label" width="{$#width}">
      	 <label for="enabled" runat="server">Enabled</label>
       </td>
       <td class="form_field">
         <input name="enabled" type="checkbox" id="enabled" value="1" checked="true" runat="server">
       </td>
     </tr>

     </core:optional>

     <tr>
      <td class="whiteheader_center" colspan="2">&nbsp;</td>
     </tr>

	 <tr>
      <td>&nbsp;</td>
      <td class="form_field">

      		<core:default for="divisionID">
      			<input type="submit" name="create" value="Create" runat="server">
            </core:default>
            <core:optional for="divisionID">
      			<input type="submit" name="save" value="Save" runat="server">

            </core:optional>
            <input type="submit" name="clean" value="Clean" runat="server">
            <input type="submit" name="divisions" value="Back to all divisions" runat="server">

      </td>
</tr>

</table>
</form>

